package com.wanpinghui.wphlibrary.model.message.bean;

import com.google.gson.Gson;

/**
 * Created by xiongning on 17-12-6.
 */

public class Messages {

    private int type;

    private String msg;

    private String ext;

    public String getExt() {
        return ext;
    }

    public void setExt(String ext) {
        this.ext = ext;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Messages(int type, String msg, String ext) {
        this.type = type;
        this.msg = msg;
        this.ext = ext;
    }

    public Messages(int type, String msg) {
        this.type = type;
        this.msg = msg;
    }

    public static Messages getMessages(String messages){
        try {
            return new Gson().fromJson(messages, Messages.class);
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }
}
